home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
038a
/
baswiz17.zip
/
CALC.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-09-21
|
1KB
|
38 lines
' +----------------------------------------------------------------------+
' | |
' | BASWIZ Copyright (c) 1990-1991 Thomas G. Hanlin III |
' | |
' | The BASIC Wizard's Library |
' | |
' +----------------------------------------------------------------------+
DECLARE SUB Evaluate (Expression$, Result!, ErrCode%)
DEFINT A-Z
Expr$ = COMMAND$
Evaluate Expr$, Result!, ErrCode
SELECT CASE ErrCode
CASE 0
PRINT Expr$; " =";
IF ABS(Result!) = Result! THEN
PRINT Result!
ELSE
PRINT " "; Result!
END IF
CASE 2
PRINT "Missing number"
CASE 4
PRINT "Unbalanced parentheses"
CASE 8
PRINT "CALC Copyright (c) 1990-1991 Thomas G. Hanlin III"
PRINT " Syntax : CALC numeric expression"
PRINT " Example: CALC 2+3*4
CASE 9
PRINT "Division by zero"
CASE ELSE
PRINT "Error"
END SELECT